home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / ldapjdk.jar / netscape / ldap / LDAPSchemaElement.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-04-13  |  2.2 KB  |  74 lines

  1. package netscape.ldap;
  2.  
  3. public abstract class LDAPSchemaElement {
  4.    public static final int unknown = 0;
  5.    public static final int cis = 1;
  6.    public static final int binary = 2;
  7.    public static final int telephone = 3;
  8.    public static final int ces = 4;
  9.    // $FF: renamed from: dn int
  10.    public static final int field_0 = 5;
  11.    public static final int integer = 6;
  12.    protected static final String cisString = "1.3.6.1.4.1.1466.115.121.1.15";
  13.    protected static final String binaryString = "1.3.6.1.4.1.1466.115.121.1.5";
  14.    protected static final String telephoneString = "1.3.6.1.4.1.1466.115.121.1.50";
  15.    protected static final String cesString = "1.3.6.1.4.1.1466.115.121.1.26";
  16.    protected static final String intString = "1.3.6.1.4.1.1466.115.121.1.27";
  17.    protected static final String dnString = "1.3.6.1.4.1.1466.115.121.1.12";
  18.    protected String oid = "";
  19.    protected String name = "";
  20.    protected String description = "";
  21.    protected String attrName;
  22.  
  23.    protected LDAPSchemaElement() {
  24.    }
  25.  
  26.    protected LDAPSchemaElement(String var1, String var2, String var3) {
  27.       this.name = var1;
  28.       this.oid = var2;
  29.       this.description = var3;
  30.    }
  31.  
  32.    public String getName() {
  33.       return this.name;
  34.    }
  35.  
  36.    public String getOID() {
  37.       return this.oid;
  38.    }
  39.  
  40.    public String getDescription() {
  41.       return this.description;
  42.    }
  43.  
  44.    protected void update(LDAPConnection var1, int var2, LDAPAttribute var3) throws LDAPException {
  45.       LDAPAttribute[] var4 = new LDAPAttribute[]{var3};
  46.       this.update(var1, var2, var4);
  47.    }
  48.  
  49.    protected void update(LDAPConnection var1, int var2, LDAPAttribute[] var3) throws LDAPException {
  50.       LDAPModificationSet var4 = new LDAPModificationSet();
  51.  
  52.       for(int var5 = 0; var5 < var3.length; ++var5) {
  53.          var4.add(var2, var3[var5]);
  54.       }
  55.  
  56.       var1.modify("cn=schema", var4);
  57.    }
  58.  
  59.    protected void update(LDAPConnection var1, int var2, String var3) throws LDAPException {
  60.       LDAPAttribute var4 = new LDAPAttribute(var3, this.getValue());
  61.       this.update(var1, var2, var4);
  62.    }
  63.  
  64.    public void add(LDAPConnection var1) throws LDAPException {
  65.       this.update(var1, 0, (String)this.attrName);
  66.    }
  67.  
  68.    public void remove(LDAPConnection var1) throws LDAPException {
  69.       this.update(var1, 1, (String)this.attrName);
  70.    }
  71.  
  72.    public abstract String getValue();
  73. }
  74.